package com.easyexcell.easyexcellexample.utils.esayexcell.bo;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.easyexcell.easyexcellexample.dto.QuotationRecordDetailedExportDto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 报价物明细导入列表
 *
 * @author c.c
 * @Since 2023/6/6
 * @Time 19:18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class QuotationRecordDetailedExportBo {

  /**
   * 标的物名字
   **/
  private String planItemId;

  /**
   * 标的物名字
   **/
  @ExcelProperty(value = "标的物名字", index = 0)
  private String name;

  /**
   * 标的物编码
   **/
  @ExcelProperty(value = "标的物编码", index = 1)
  private String code;

  /**
   * 品目名称
   **/
  @ExcelProperty(value = "采购品类", index = 2)
  private String categoryName;

  /**
   * 品目编码
   **/
  @ExcelProperty(value = "品类编码", index = 3)
  private String categoryCode;

  /**
   * 规格型号
   **/
  @ExcelProperty(value = "规格型号", index = 4)
  private String specification;


  /**
   * 采购数量
   **/
  @ExcelProperty(value = "采购数量", index = 5)
  private Double procurementQuantity;

  /**
   * 计量单位
   **/
  @ExcelProperty(value = "计量单位", index = 6)
  private String unit;

  /**
   * 描述
   **/
  @ExcelProperty(value = "标的物编码", index = 13)
  private String remark;

  /**
   * 税率
   **/
  @ExcelProperty(value = "税率(%)", index = 8)
  private Double taxRate;

  /**
   * 不含税单价
   **/
  @ExcelProperty(value = "标的物编码", index = 11)
  private String 不含税单价;

  /**
   * 不含税合价
   **/
  @ExcelProperty(value = "标的物编码", index = 12)
  private WriteCellData<String> 不含税合价;

  /**
   * 含税单价
   **/
  @ExcelProperty(value = "标的物编码", index = 7)
  private Double taxUnitPrice;

  /**
   * 含税单价
   **/
  @ExcelProperty(value = "含税总价（元）", index = 10)
  private WriteCellData<String> taxAllPrice;

  /**
   * 总报价
   **/
//  @ApiModelProperty("总报价")
//  @ExcelProperty(value = "标的物编码",index = 2)
//  private Double currentPrice;
  public static QuotationRecordDetailedExportBo convertToQuotationRecordDetailedExportBo(QuotationRecordDetailedExportDto item) {
    if (item == null) {
      return null;
    }
    QuotationRecordDetailedExportBo result = new QuotationRecordDetailedExportBo();
    result.setPlanItemId(item.getPlanItemId());
    result.setName(item.getName());
    result.setCode(item.getCode());
    result.setCategoryName(item.getCategoryName());
    result.setCategoryCode(item.getCategoryCode());
    result.setSpecification(item.getSpecification());
    result.setProcurementQuantity(item.getProcurementQuantity());
    result.setUnit(item.getUnit());
    result.setRemark(item.getRemark());
    result.setTaxRate(item.getTaxRate());
//    result.setNoTaxUnitPrice(item.getNoTaxUnitPrice());
//    result.setNoTaxAllPrice(item.getNoTaxAllPrice());
    result.setTaxUnitPrice(item.getTaxUnitPrice());
//    result.setTaxAllPrice(item.getTaxAllPrice());
//    result.setCurrentPrice(item.getCurrentPrice());
    return result;
  }
}
